<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <title>覆盖物事件</title>
    <link rel="stylesheet" href="https://cache.amap.com/lbs/static/main1119.css"/>
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.10&key=7b5b68d8eedd376a331579722714be19"></script>
    <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
</head>
<body>
<div id="container"></div>
<div id="tip">点击地图上的覆盖物试试</div>
<script type="text/javascript">
  //初始化地图对象，加载地图
  var map = new AMap.Map("container", {
    resizeEnable: true
  });
  var marker = new AMap.Marker({
    map: map,
    icon: "https://webapi.amap.com/theme/v1.3/markers/n/mark_b.png",
    position: [116.405467, 39.907761]
  });
  map.setFitView();
  marker.on('click', function() {
    alert('您点击了点');
  });
</script>
</body>
</html>